﻿@page
@model AdminUI.Pages.Dialog.SelectGridDemoModel
@{
    ViewData["Title"] = "选择用户Demo";
}

@section body {

    <f:Panel ID="Panel1" ShowBorder="false" ShowHeader="false" BodyPadding="10" Layout="Fit" IsViewPort="true">
        <Toolbars>
            <f:Toolbar ID="Toolbar1">
                <Items>
                    <f:Button ID="btnClose" Icon="SystemClose" Text="关闭">
                        <Listeners>
                            <f:Listener Event="click" Handler="F.activeWindow.hide();"></f:Listener>
                        </Listeners>
                    </f:Button>
                    <f:Button ID="btnSubmit" Text="确定" Icon="SystemSave" OnClick="@Url.Handler("BtnSubmit_Click")" OnClickParameter1="@(new Parameter("selectedRowIDs","F.ui.Grid1.getSelectedRows()"))"></f:Button>
                    <f:ToolbarFill></f:ToolbarFill>
                    <f:DropDownList ID="ddlCondition" SelectedValue="" Width="150">
                        <f:ListItem Text="== 请选择条件 ==" Value="" />
                        <f:ListItem Text="用户ID" Value="UserID" />
                        <f:ListItem Text="用户名" Value="UserName" />
                    </f:DropDownList>
                    <f:TriggerBox ID="ttbSearch" ShowLabel="false" EmptyText="请输入搜索关键字" TriggerIcon="Search" OnTriggerClick="@Url.Handler("Grid_DoAction")" OnTriggerClickFields="Region2"
                                  OnTriggerClickParameter1="@(new Parameter("actionType", "search", ParameterMode.String))"
                                  OnTriggerClickParameter2="@(new Parameter("searchText", "F.ui.ttbSearch.getValue()"))"
                                  OnTriggerClickParameter3="@(new Parameter("searchCondition", "F.ui.ddlCondition.getValue()"))">
                    </f:TriggerBox>
                </Items>
            </f:Toolbar>
        </Toolbars>
        <Items>
            <f:Grid ID="Grid1" BoxFlex="1" ShowBorder="true" ShowHeader="false" EnableTextSelection="true" EnableColumnLines="true" EnableCheckBoxSelect="true" EnableMultiSelect="false" DataIDField="UserID" DataTextField="UserName"
                    AllowPaging="true" PageSize="@ViewBag.PageSize" IsDatabasePaging="true" OnPageIndexChanged="@Url.Handler("Grid_DoAction")" OnPageIndexChangedFields="Grid1"
                    AllowSorting="true" SortField="UserID" SortDirection="DESC" OnSort="@Url.Handler("Grid_DoAction")"
                    OnSortFields="Grid1" DataSource="@ViewBag.DataSource" RecordCount="@ViewBag.Total">
                <Columns>
                    <f:RowNumberField HeaderText="#" TextAlign="Center" />
                    <f:RenderField HeaderText="用户ID" DataField="UserID" QuickSortField="true" FieldType="Int" Width="100" TextAlign="Center" />
                    <f:RenderField HeaderText="账号" DataField="UserName" Width="120" />
                    <f:RenderField HeaderText="姓名" DataField="TrueName" Width="100" />
                    <f:RenderField HeaderText="手机号" DataField="Mobile" Width="120" TextAlign="Center" />
                    <f:RenderField HeaderText="性别" DataField="Sex" Width="60" TextAlign="Center" />
                    <f:RenderField HeaderText="身份证" DataField="IDCard" Width="150" />
                    <f:RenderField HeaderText="备注" DataField="Memo" Width="200" ExpandUnusedSpace="true" />
                </Columns>
                <PageItems>
                    <f:ToolbarSeparator></f:ToolbarSeparator>
                    <f:ToolbarText Text="每页记录数："></f:ToolbarText>
                    <f:DropDownList ID="ddlGridPageSize" Width="60" SelectedValue="@ViewBag.PageSize" OnSelectedIndexChanged="@Url.Handler("Grid_DoAction")" OnSelectedIndexChangedParameter1="@(new Parameter("actionType","changePageSize",ParameterMode.String))" OnSelectedIndexChangedFields="Panel1">
                        <Items>
                            <f:ListItem Text="5" Value="5"></f:ListItem>
                            <f:ListItem Text="10" Value="10"></f:ListItem>
                            <f:ListItem Text="20" Value="20"></f:ListItem>
                            <f:ListItem Text="30" Value="30"></f:ListItem>
                            <f:ListItem Text="50" Value="50"></f:ListItem>
                            <f:ListItem Text="100" Value="100"></f:ListItem>
                            <f:ListItem Text="200" Value="200"></f:ListItem>
                        </Items>
                    </f:DropDownList>
                </PageItems>
            </f:Grid>
        </Items>
    </f:Panel>


}

